feat: added header bar during mise install#6022
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds a header progress bar during the mise install command to provide users with an overview of the overall installation progress across all tools being installed.
Key changes:
- Introduces a new
HeaderReportprogress bar component with a specific visual style - Modifies the multi-progress report system to support a global header that tracks overall tool installation progress
- Updates the toolset installation logic to initialize, increment, and finalize the header progress bar
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/ui/progress_report.rs | Adds HEADER_TEMPLATE style and HeaderReport struct for the new header progress bar |
| src/ui/multi_progress_report.rs | Refactors singleton pattern and adds header management methods |
| src/toolset/mod.rs | Integrates header progress bar into the tool installation workflow |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
|
||
| let mpr = Arc::new(Self::new()); | ||
| *mutex = Some(Arc::downgrade(&mpr)); | ||
| *guard = Some(mpr.clone()); |
There was a problem hiding this comment.
Storing an Arc directly in the static instance creates a memory leak - the MultiProgressReport will never be dropped. Consider keeping the original Weak reference pattern to allow proper cleanup when no other references exist.
| impl HeaderReport { | ||
| pub fn new(prefix: String) -> HeaderReport { | ||
| ui::ctrlc::show_cursor_after_ctrl_c(); | ||
| let pb = ProgressBar::new(100) |
There was a problem hiding this comment.
The magic number 100 should be defined as a named constant or explained with a comment. It's unclear why the initial length is set to 100 when it gets overridden by set_length().
| let pb = ProgressBar::new(100) | |
| // The initial length is arbitrary and will be overridden by set_length(). | |
| let pb = ProgressBar::new(DEFAULT_PROGRESS_LENGTH) |
| fn inc(&self, delta: u64) { self.pb.inc(delta); } | ||
| fn set_position(&self, pos: u64) { | ||
| self.pb.set_position(pos); | ||
| if Some(self.pb.position()) == self.pb.length() { |
There was a problem hiding this comment.
This comparison will fail if pb.length() returns None. Use self.pb.length().map_or(false, |len| self.pb.position() == len) to handle the case where length is not set.
| if Some(self.pb.position()) == self.pb.length() { | |
| if self.pb.length().map_or(false, |len| self.pb.position() == len) { |
71c90f6 to
22e6f4d
Compare
Hyperfine Performance
|
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2025.8.9 x -- echo |
18.7 ± 0.4 | 18.0 | 21.8 | 1.00 |
mise x -- echo |
18.9 ± 0.3 | 18.3 | 20.3 | 1.01 ± 0.03 |
mise env
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2025.8.9 env |
18.3 ± 0.6 | 17.5 | 22.6 | 1.00 |
mise env |
18.3 ± 0.4 | 17.7 | 19.9 | 1.00 ± 0.04 |
mise hook-env
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2025.8.9 hook-env |
17.7 ± 0.3 | 17.1 | 18.8 | 1.00 |
mise hook-env |
18.2 ± 0.5 | 17.2 | 21.0 | 1.03 ± 0.04 |
mise ls
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2025.8.9 ls |
17.4 ± 0.4 | 16.7 | 18.7 | 1.00 |
mise ls |
17.6 ± 0.5 | 16.7 | 19.2 | 1.01 ± 0.03 |
xtasks/test/perf
| Command | mise-2025.8.9 | mise | Variance |
|---|---|---|---|
| install (cached) | 168ms | ✅ 105ms | +60% |
| ls (cached) | 63ms | 63ms | +0% |
| bin-paths (cached) | 66ms | 66ms | +0% |
| task-ls (cached) | 486ms | 480ms | +1% |
✅ Performance improvement: install cached is 60%
### 📦 Registry - enable kubecolor test by [@risu729](https://github.com/risu729) in [#6008](#6008) - fix os specific backends for usage by [@risu729](https://github.com/risu729) in [#6007](#6007) - use aqua backend for restish by [@risu729](https://github.com/risu729) in [#5986](#5986) - add cfssljson ([aqua:cloudflare/cfssl/cfssljson](https://github.com/cloudflare/cfssl/cfssljson)) by [@disintegrator](https://github.com/disintegrator) in [#6013](#6013) - add claude-squad ([aqua:smtg-ai/claude-squad](https://github.com/smtg-ai/claude-squad)) by [@TyceHerrman](https://github.com/TyceHerrman) in [#5894](#5894) ### 🚀 Features - **(aqua)** make bin paths executable by [@risu729](https://github.com/risu729) in [#6010](#6010) - added header bar during `mise install` by [@jdx](https://github.com/jdx) in [#6022](#6022) ### 🐛 Bug Fixes - **(aqua)** improve warnings for packages without repo_owner and repo_name (2nd attempt) by [@risu729](https://github.com/risu729) in [#6009](#6009) - version prefix detection by [@risu729](https://github.com/risu729) in [#5943](#5943) - respect MISE_DEFAULT_CONFIG_FILENAME by [@risu729](https://github.com/risu729) in [#5899](#5899) ### New Contributors - @disintegrator made their first contribution in [#6013](#6013)
No description provided.